/*
 * @Author: 热的洛夫斯基 501436989@qq.com
 * @Date: 2025-10-05 19:46:25
 * @LastEditors: 热的洛夫斯基 501436989@qq.com
 * @LastEditTime: 2025-10-05 20:04:31
 * @FilePath: /react-0611/src/components/asyncdata.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
interface IAsyncData<T> {
    loading: boolean;
    data: T | null;
    error: Error | null;
}

export  interface tsDate {
    id: number | string;
    name: string;
    age: number;
}
export async function getData(): Promise<IAsyncData<tsDate[]>> {
    await new Promise(resolve => setTimeout(resolve, 1000));
    return {
        loading: false,
        data: [{
            id: 1,
            name: '热的洛夫斯基',
            age: 18,
        }, {
            id: 2,
            name: '热的洛夫斯基',
            age: 25,
        }],
        error: null,
    }

}